#extension GL_EXT_gpu_shader4 : enable

uniform sampler2D IjSampler;
uniform sampler2D deltaIjSampler;
uniform sampler2D RjSampler;

float FormFactor(float shooterDeltaArea);

void main(void)
{
	vec4 Ij = texture2D(IjSampler, gl_TexCoord[0].st);
	vec4 deltaIj = texture2D(deltaIjSampler, gl_TexCoord[0].st);
	vec4 Rj = texture2D(RjSampler, gl_TexCoord[0].st);
	const vec3 shootDeltaBj = vec3(10000, 10000, 10000);

	float Fij = FormFactor(0.0);
	vec4 RjPrime = vec4(shootDeltaBj * Fij, 1);

	vec4 deltaRj = RjPrime - Rj;
	gl_FragData[0] = Ij + deltaRj;
	gl_FragData[1] = deltaIj + deltaRj;
	gl_FragData[2] = RjPrime;
}
